<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">
    
    <body>

        <ui:composition template="./TemplatePrincipal.xhtml">

            <ui:define name="left">
               
            </ui:define>

            <ui:define name="right">
               
            </ui:define>

            <ui:define name="content">
                <f:view>
                     <p:panel header="Modulo de Categoria">
                    <h:form>
                        <p:growl life="6000"/>
                        <h:panelGrid columns="2">
                            <h:outputLabel value="Clave:" for="clave" />
                            <p:inputText id="clave" value="#{categoryBean.category.clave}" title="Clave" required="true" validatorMessage="clave: 5 numeros">
                                <f:validateRegex pattern="[0-9]{5}"/>
                            </p:inputText>
                            <h:outputLabel value="Descripcion:" for="descripcion" />
                            <p:inputText id="descripcion" value="#{categoryBean.category.descripcion}" title="Descripcion" required="true" validatorMessage="descripcion: letras minimo 3">
                                <f:validateRegex pattern="[a-zA-Z\s]{3,45}"/>
                            </p:inputText>
                            <h:outputLabel value="Color:" for="color" />
                            <p:inputTextarea rows="4" cols="30" id="color" value="#{categoryBean.category.color}" title="Color" />
                            <p:commandButton action="CategoriaConfirmar" value="Aceptar" ajax="false"/>
                            <p:commandButton action="Categoria" value="Cancelar" immediate="true" ajax="false"/>
                        </h:panelGrid>
                    </h:form>
                     </p:panel>
                </f:view>

            </ui:define>

        </ui:composition>

    </body>
</html>
